// eslint-disable-next-line no-unused-vars
import React from "react";
import { getTableProps } from "components/searchTable/SearchTable.jsx";

export  function getFormConfig() {
  return [
    { label: "流程实例ID", key: "processInstanceIds" },
    { label: "任务ID", key: "taskId" },
    { label: "变量名称",   key: "name" },
  ];
}

export function getTableColumns() {
  return [
			{
				title: "序号",
				dataIndex: "id",
				render: (value, record, index) => {
          const { page: {  pageNum, pageSize } } = this.state;
					return (pageNum - 1) * pageSize + index + 1;
				},
			},
			{ title: "流程实例ID", dataIndex: "processInstanceId" },
			{ title: "任务ID", dataIndex: "taskId" },
			{ title: "变量名称", dataIndex: "name" },
			{ title: "变量类型", dataIndex: "type" },
			{ title: "变量值", dataIndex: "value" },
	 ];
}
export function getAntTableProps() {
  const { page: { pageNum, pageSize } } = this.state;
  const { runningVariableList, loading } = this.props;
  const { datas = [], totalCount } = runningVariableList;
  return getTableProps({
    rowKey: "id",
    columns: this.getTableColumns(),
    dataSource: datas,
    loading: loading.effects["FlowMonitor/runningVariableList"],
    pagination: {
      current: pageNum,
      pageSize,
      total: totalCount,
      onChange: this.handlePageChange,
      onShowSizeChange: this.handlePageChange,
    },
  });
}
